<extend name="extends/extend" />
<block name="loadCss">
    <!--美化 checkbox radio css-->
    <link href="__admin__/css/plugins/iCheck/custom.css" rel="stylesheet">
</block>
<block name="script">
    <!--美化 checkbox radio js-->
    <script src="__admin__/js/plugins/iCheck/icheck.min.js"></script>
    <!--表单验证 插件-->
    <script src="__admin__/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="__admin__/js/plugins/validate/messages_zh.min.js"></script>
    <script>
        $(document).ready(function () {
            $(".i-checks").iCheck({
                checkboxClass:"icheckbox_square-green",
                radioClass:"iradio_square-green",
            });
            $('#checkForm').validate({
                submitHandler:function(form) {
                    form.submit();
                },
                highlight: function(e) {
                    $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
                },
                success: function(e) {
                    e.closest(".form-group").removeClass("has-error")
                },
                errorClass: "help-block m-b-none",
                rules:{
                    status:{required:true}
                }
            });
        });
    </script>
</block>
<block name="content">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>分配 [ {$auth_group.title} ] 用户组权限节点</h5>
                        <div class="ibox-tools">
                            <a href="javascript:history.go(-1);" class="btn btn-outline btn-info btn-xs">
                                <i class="fa fa-arrow-circle-left"></i> 返回
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="" class="form-horizontal" id="checkForm">
                           <div class="form-group">
                               <div class="col-sm-6  col-sm-offset-1">
                                   <table class="table table-bordered table-hover">
                                       <thead>
                                       <tr>
                                           <th colspan="2">请勾选要分配的权限</th>
                                       </tr>
                                       </thead>
                                       <tbody>
                                       <volist name="ruleList" id="v">
                                           <tr>
                                               <td width="25"><input type="checkbox" <in name="v.auth_rule_id" value="$group_rules">checked</in> name="rules[]" value="{$v.auth_rule_id}" class="i-checks"></td>
                                               <td>{$v.preffix}{$v.title}</td>
                                           </tr>
                                       </volist>
                                       </tbody>
                                   </table>
                               </div>
                           </div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-1">
                                    {:token()}
                                    <button class="btn btn-primary" type="submit">保存</button>
                                    <button class="btn btn-primary" type="reset">重置</button>
                                    <button class="btn btn-primary" type="button" onclick="history.go(-1)">返回</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>